package com.abel.demo.domain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import java.util.ArrayList;
import java.util.List;

import com.abel.demo.model.SecAuthorityModel;

/**
* @author abel.lin
* @date_time 2018-07-17 14:33
* @description
*/
public class SecAuthorityDomain extends SecAuthorityModel {

    public static SecAuthorityDomain genDomain(SecAuthorityModel model){
        if(model == null){
            model = new SecAuthorityModel();
        }
        SecAuthorityDomain domain = JSON.parseObject(JSON.toJSONString(model), SecAuthorityDomain.class);
        return domain;
    }

    public static List<SecAuthorityDomain> genDomainList(List<SecAuthorityModel> modelList){
        if(modelList == null){
            modelList = new ArrayList<SecAuthorityModel>();
        }
        List<SecAuthorityDomain> domainList = JSONArray.parseArray(JSONArray.toJSONString(modelList), SecAuthorityDomain.class);
        return domainList;
    }

}
